//
//  DateTool.swift
//  Re-mygreetings
//
//  Created by Jia Chen on 2022/8/9.
//

import UIKit

class DateTool: NSObject {
    
    // 获取当前时间时分秒
    static public func getHourMinSec(date: Date) -> (Int, Int, Int) {

        let calendar: Calendar = Calendar(identifier: .gregorian)
        var comps: DateComponents = DateComponents()
        comps = calendar.dateComponents([.hour, .minute,.second], from: date)
        
        return (comps.hour ?? 0, comps.minute ?? 0, comps.second ?? 0)
    }
    

}
